import request from '@/utils/request'
import headApi from '@/utils/hade';
const Mvc = '';
// 登录方法
export function login(username, password, code, uuid, url, invitationCode) {
    console.log('若依登录方法流程src/api/login')
    const data = {
        username,
        password,
        code,
        uuid,
        url,
        invitationCode
    }
    return request({
        url: headApi + '/login',
        method: 'post',
        data: data
    })
}

// 注册方法
export function register(data) {
    return request({
        url: headApi + '/register',
        headers: {
            isToken: false
        },
        method: 'post',
        data: data
    })
}

// 获取用户详细信息
export function getInfo() {
    return request({
        url: headApi + '/getInfo',
        method: 'get'
    })
}

// 退出方法
export function logout() {
    return request({
        url: headApi + '/logout',
        method: 'post'
    })
}

// 获取验证码
export function getCodeImg() {
    return request({
        url: headApi + '/captchaImage',
        method: 'get'
    })
}

// ..注册
export function registerAPI(param) {
    return request({
        url: headApi + '/selfcom/user/register',
        method: 'post',
        data: param
    })
}
// ..获取信息是否是平台还是用户还是租户
export function getIdentityAndTopId(param) {
    return request({
        url: headApi + '/selfcom/user/getIdentityAndTopId',
        method: 'get'
    })
}


// ..注册成功后新增一下用户钱包
export function addCapUserWallet(param) {
    return request({
        url: headApi + Mvc + '/capUserWallet/addCapUserWallet',
        method: 'post',
        data: param
    })
}
// ..修改密码
export function resetPwd(param) {
    return request({
        url: headApi + Mvc + '/selfcom/user/resetPwd',
        method: 'put',
        data: param
    })
}
//自带重置密码
export function updatePwd(param) {
    return request({
        url: headApi + '/system/user/profile/updatePwd',
        method: 'put',
        params: param
    })
}
//登陆页面获取验证码
export function getAliDy(param) {
    return request({
        url: headApi + '/selfcom/user/sendSms',
        method: 'post',
        data: param
    })
}
//不需要token获取验证码
export function getAliDy1(param) {
    return request({
        url: headApi + '/selfcom/user/sendSms1',
        method: 'post',
        data: param
    })
}

//登陆页面忘记密码
export function forgetPassword(param) {
    return request({
        url: headApi + '/selfcom/user/forgetPassword',
        method: 'post',
        data: param
    })
}